package com.wanxi.interf;

public class VehicleTest {
    public static void main(String[] args) {
        Worker worker=new Worker();
        Vehicle [] vehicles= new Vehicle[3];
        vehicles[0]=new Bicycle("捷安特","红色");
        vehicles[1]=new Car("奥迪","红色","122335452");
        vehicles[2]=new ElectricVehicle("BUD","绿色");
        for (int i = 0; i < vehicles.length; i++) {
            worker.takingVehicle(vehicles[i]);
            if(vehicles[i]instanceof Power){
//                Power power = (Power) vehicles[i];
//                power.power();

                ((Power) vehicles[i]).power();
            }

        }
    }
}
